/*寻找特殊偶数*/
#include <stdio.h>
#include <stdlib.h>

int main()
{
	int min,max,se[1000],counter,a,b,c,d,j;
	while (scanf("%d %d",&min,&max) != EOF)
	{
		if (min == 0 || max == 0)
		{
			exit(0);
		}
		if ( min < 1000 || max < 1000 || max < min)
		{
			printf("Error\n");
			continue;
		}
		for ( int i=min ; i<=max ; i++)
		{
			a = i%10;
			b = (i%100 - a)/10;
			c = (i%1000 - b*10 - a)/100;
			d = (i - c*100 - b*10 - a)/1000;
			if ( a%2 == 0 && a != b && b!=c && c!=d && a!=c && a!=d && b!=d)
			{
				se[j] = i;
				j += 1;
			}
		}
		for (int k=0 ; k<j ; k++)
		{
			printf("%d  ",se[k]);
		}
		printf("\n");
		counter = j;
		printf("counter=%d\n",counter);
		se[1000] = {0};
		j = 0;
	}
	return 0;
 } 
